import React from "react";
import {RouterType} from '../types'
import {Navigate} from 'react-router-dom'
import { AppsO, HomeO, CartO, Contact } from "@react-vant/icons";

import Sigin from '../page/Sigin'
import Login from '../page/Login'
import Home from '../page/Home'
import Address from '../page/Address'

import Cart from '../page/Home/Cart'
import Class from '../page/Home/Class'
import HomeC from '../page/Home/HomeC'
import My from '../page/Home/My'
import Detail from '../page/Detail'
import SearchC from '../page/Search'

const router:RouterType[]=[{
    path:'/',
    element:<Navigate to="/login"/>
},{
    path:"/address",
    element:<Address/>
},{
    path:'/search',
    element:<SearchC/>
},{
    path:'/detail/:id',
    element:<Detail/>
},{
    path:'/home',
    element:<Home/>,
    children:[{
        path:'/home/home',
        element:<HomeC/>,
        ioc:<HomeO />
    },{
        path:'/home/class',
        element:<Class/>,
        ioc:<AppsO />
    },{
        path:'/home/cart',
        element:<Cart/>,
        ioc:<CartO />
    },{
        path:'/home/my',
        element:<My/>,
        ioc:<Contact />
    }]
},{
    path:"/login",
    element:<Login/>
},{
    path:"/sigin",
    element:<Sigin/>
}]
export default router